#include <gui/screen4_screen/Screen4View.hpp>
extern "C"
{
#include "user_include.h"
}
Screen4View::Screen4View()
{
}

void Screen4View::setupScreen()
{
    Screen4ViewBase::setupScreen();
}

void Screen4View::tearDownScreen()
{
    Screen4ViewBase::tearDownScreen();
}

void Screen4View::handleTickEvent(void)
{
    static int8_t tick = 0;
    static uint16_t para[4] = {1, 23, 34, 23};
    uint8_t i = 0;
    struct tm t;
    tick++;
    if (tick % 6 == 0)
    {
        tick = 0;
        if (driver_button_struct.key_value == BUTTON1_PRESS_FLAG)
        {
            driver_button_struct.key_value = 0;
            application().gotoScreen3ScreenSlideTransitionEast();
        }
        else if (driver_button_struct.key_value == BUTTON2_PRESS_FLAG)
        {
            driver_button_struct.key_value = 0;
            application().gotoscreen2ScreenSlideTransitionEast();
        }
        else if (driver_button_struct.key_value == BUTTON3_PRESS_FLAG)
        {
            driver_button_struct.key_value = 0;
            application().gotoScreen4ScreenSlideTransitionEast();
        }
    }
}

void Screen4View::model_view(uint8_t flag, ...)
{
    int32_t para1;
    va_list argptr;
    va_start(argptr, flag);

    para1 = va_arg(argptr, int32_t);
    if (flag == 1)
    {
        if (para1 == 1)
        {
            application().gotoScreen3ScreenSlideTransitionEast();
        }
        else if (para1 == 2)
        {
            application().gotoscreen2ScreenSlideTransitionEast();
        }
        else if (para1 == 3)
        {
            application().gotoScreen4ScreenSlideTransitionEast();
        }
    }
    va_end(argptr);
}